home *** CD-ROM | disk | FTP | other *** search
- Path: ccnet.com!usenet
- From: paulp@ccnet.com (Paul Pedriana)
- Newsgroups: comp.lang.c++
- Subject: MSVC++ 4.0 compiler really doesn't call subclassed virtual functions in this case.
- Date: Sat, 24 Feb 1996 19:36:22 GMT
- Organization: Two-Bit Software
- Message-ID: <4gnpf9$q8o@ccnet2.ccnet.com>
- NNTP-Posting-Host: h96-194.ccnet.com
-
- I've got this problem that I know is not my fault. I declare classes
- class A{
- virtual blah();
- };
-
- class B:public A{
- virtual blah();
- };
-
- B myB;
-
- And at runtime, calling myB.blah(); causes E:blah() to be called. The reason I
- know it is not my fault is because it goes away if I delete the object files for
- A and B and recompile. The first time after deleting the object files, the bug
- goes away, then the next compile (without re-deleting the obj files) the bug
- comes back. Thus I can fix the problem by always deleting the obj files before
- compiling.
-
- Has anybody else had this problem with VC++ 4.0? Is it related to incremental
- compiling and linking?
-
- My guess is that if you compile the above example, code, you won't see this
- problem, as in my case the classes aren't quite so simple, and only happen for
- some classes, and not for others.
-
- Paul Pedriana
- paulp@ccnet.com
-
-